package cn.laixueit.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public void hello(){
        System.out.println("hello....");
    }

    @RequestMapping("/hello2")
    public void hello2(){
        System.out.println("hello2....");
    }

    @RequestMapping("findAll")
    public ModelAndView findAll(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("index");
        modelAndView.addObject("msg","hello springmvc");
        // request域中
        return modelAndView;
    }
}
